<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<style>
		/* 不定宽高元素居中 */
		.asd{
			position:absolute;
		    top:50%;
		    left: 50%;
		    -webkit-transform: translate(-50%, -50%);
		    transform: translate(-50%, -50%);
		}
	</style>
</head>
<body>
	<div class="asd">12jasjidaij3</div>
	<!-- input日期 -->
	<input type="date">
	<script>
	window.onload = function() {  
		(function(){
				var url = 'https://www.baidu.com/s?ie=utf-8&f=8&rsv_bp=0&rsv_idx=1&tn=baidu&wd=mk&rsv_pq=e379bd8200001a8c&rsv_t=ea8cxrgm03IFb44zHA261P6KziPRXAekcjwsRJtUSKLUmKweFsZFXE%2BUSrU&rqlang=cn&rsv_enter=0&rs';
				// url to json
				String.prototype.url2json=function(){
					var index = -1,
					      str = '',
					      arr = [],
					      res = {};
					if(this.indexOf('?')!=-1){
						index = this.indexOf('?');
						str = this.substring(index+1);
						arr = str.split('&');
						console.log(arr)
						for(var i=0; i<arr.length-1; i++){
							res[arr[i].split('=')[0]] = arr[i].split('=')[1];
						}
					}else{
						res = {};
					}
					return res;
				};
				console.log(url.url2json())
		})();
	}
		
	</script>
</body>
</html>